package com.silp.phoneinfo;

import java.util.ArrayList;

import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Pkg extends PhoneInfoActivity {






	public String [] pkg_str={};

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		final PackageManager pm = this.getPackageManager();

		Intent intent = new Intent(Intent.ACTION_MAIN, null);
		intent.addCategory(Intent.CATEGORY_LAUNCHER);

		final ArrayList<ResolveInfo> list =
				(ArrayList<ResolveInfo>) pm.queryIntentActivities(intent, 
						PackageManager.PERMISSION_GRANTED);
		final ArrayList<String> applicationlList = new ArrayList<String>();

		for (ResolveInfo rInfo : list)
		{

			applicationlList.add(rInfo.activityInfo.
					applicationInfo.loadLabel(pm).toString());

		}


		setListAdapter(new ArrayAdapter<String>(this, R.layout.main, applicationlList));

		ListView lv = getListView();
		lv.setTextFilterEnabled(true);
	}

}
